//
//  LzwFourDetailCollectCell.m
//  NewHalfsugar
//
//  Created by 刘志武 on 16/1/7.
//  Copyright © 2016年 刘志武. All rights reserved.
//

#import "LzwFourDetailCollectCell.h"
#import "LzwBaseImageView.h"
#import "LzwBaseLable.h"
#import "UIImageView+WebCache.h"

@interface LzwFourDetailCollectCell ()

@property (nonatomic, retain) LzwBaseImageView *myCollectImage1;
@property (nonatomic, retain) LzwBaseImageView *myCollectImage2;
@property (nonatomic, retain) LzwBaseImageView *myCollectImage3;

@property (nonatomic, retain) LzwBaseLable *myCollectLable1;
@property (nonatomic, retain) LzwBaseLable *myCollectLable2;
@property (nonatomic, retain) LzwBaseLable *myCollectLable3;


@end

@implementation LzwFourDetailCollectCell

-(void)dealloc{
    [_myCollectImage1 release];
    [_myCollectImage2 release];
    [_myCollectLable1 release];
    [_myCollectLable2 release];
    [super dealloc];
}

-(instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    
    if (self) {
        [self creatViews];
    }
    
    return self;
}

- (void)creatViews{
    
    //大图片
    self.myCollectImage1 = [[LzwBaseImageView alloc]initWithFrame:CGRectMake(0, 0, 160 * WIDTH, 120 * WIDTH)];
    self.myCollectImage1.backgroundColor = [UIColor orangeColor];
    [self.contentView addSubview:self.myCollectImage1];
    
    //title
    self.myCollectLable1 = [[LzwBaseLable alloc]initWithFrame:CGRectMake(1 * WIDTH, 130 * WIDTH, 160 * WIDTH, 25 * WIDTH)];
    self.myCollectLable1.textAlignment = NSTextAlignmentCenter;
    self.myCollectLable1.textColor = [UIColor lightGrayColor];
    self.myCollectLable1.font = [UIFont systemFontOfSize:15 * WIDTH];
    [self.contentView addSubview:self.myCollectLable1];
    
    //钱图片
    self.myCollectImage3 = [[LzwBaseImageView alloc]initWithFrame:CGRectMake(10 * WIDTH, 160 * WIDTH, 15 * WIDTH, 15 * WIDTH)];
    self.myCollectImage3.image = [UIImage imageNamed:@"jiage.png"];
    [self.contentView addSubview:self.myCollectImage3];
    
    
    //价格
    self.myCollectLable2 = [[LzwBaseLable alloc]initWithFrame:CGRectMake(33 * WIDTH, 160 * WIDTH, 50 * WIDTH, 20 * WIDTH)];
    self.myCollectLable2.textAlignment = NSTextAlignmentCenter;
    self.myCollectLable2.textColor = [UIColor orangeColor];
    self.myCollectLable2.font = [UIFont systemFontOfSize:14 * WIDTH];
    [self.contentView addSubview:self.myCollectLable2];
    
    //喜爱(心图片)
    self.myCollectImage2 = [[LzwBaseImageView alloc]initWithFrame:CGRectMake(90 * WIDTH, 160 * WIDTH, 15 * WIDTH, 15 * WIDTH)];
    self.myCollectImage2.image = [UIImage imageNamed:@"Love.png"];
    [self.contentView addSubview:self.myCollectImage2];
    
    //喜爱人数
    self.myCollectLable3 = [[LzwBaseLable alloc]initWithFrame:CGRectMake(105 * WIDTH, 157 * WIDTH, 50 * WIDTH, 20 * WIDTH)];
    self.myCollectLable3.textAlignment = NSTextAlignmentCenter;
    self.myCollectLable3.textColor = [UIColor orangeColor];
    self.myCollectLable3.font = [UIFont systemFontOfSize:14 * WIDTH];
    [self.contentView addSubview:self.myCollectLable3];
    
    
}

-(void)setModleF:(LzwFourDeModle *)modleF{
    
    if (_modleF != modleF) {
        [_modleF release];
        _modleF = [modleF retain];
    }
    self.myCollectLable1.text = self.modleF.title;
    self.myCollectLable2.text = self.modleF.price;
    self.myCollectLable3.text = self.modleF.likes;
    
    NSURL *url = [NSURL URLWithString:self.modleF.pic];
    
    [self.myCollectImage1 sd_setImageWithURL:url placeholderImage:nil];
    
}


@end
